<%@page import="com.netistate.pojo.Product"%>
<%@page import="com.netistate.pojo.Project"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="minWin">
	<table id="" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="bg_color_common" style="font-size: 12">

		<tr>
			<td align="right" title="产品名称及型号">请选择项目:</td>
			<td>
				<select style="width: 140px;" name="pid" id="pid">
				  <% List<Project> projectList = (List<Project>)request.getSession().getAttribute("projectList");
				  	 Product product = (Product)request.getSession().getAttribute("editProduct");
					 for(Project p : projectList){
				  %>
					<option value="<%=p.getId() %>" <%=p.getProjectName().equals(product.getProject().getProjectName())?"selected='selected'":"" %> title="<%=p.getProjectName() %>"><%=p.getProjectName() %></option>
					<%}%>
				</select>
			</td>
		</tr>

		<tr>
			<td align="right" title="产品名称及型号">产品名称及型号:</td>
			<td>
			    <input type="hidden" id="id" name="id" value="${sessionScope.editProduct.id }"/>
				<input id="pro" name="pro" style="width:280px;" value="${sessionScope.editProduct.product }" />
			</td>
		</tr>
		<%-- <tr>
			<td align="right" title="产品原始版本">产品原始版本:	</td>
			<td><input id="preVersion" name="preVersion" value="${sessionScope.editProduct.preVersion }"/></td>
		</tr> --%>
		<tr>
			<td align="right" title="产品更新版本">产品更新版本:	</td>
			<td><input id="postVersion" style="width:280px;" name="postVersion" value="${sessionScope.editProduct.postVersion }" /></td>
		</tr>
		
		<tr>
			<td align="right" title="出厂日期">出厂日期:</td>
			<td>
				<%
			       Date date = new Date();
			       SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd");
				   String endString = sdFormat.format(date);
				   Calendar calendar = Calendar.getInstance();
				   calendar.setTime(date);
				   calendar.add(Calendar.DATE,-7);
			       Date date2 = calendar.getTime();
				   String startString = sdFormat.format(date2);
				   String dayStart = (String)request.getSession().getAttribute("dayStartQuery");
				   if(dayStart != null){
					  startString = dayStart;
					  }
				   else{
					  startString = "Today";
				   }
				%>
				<input id="outDate" name="outDate" type="text" style="width:80px" onclick="MyCalendar.SetDate(this)" value="${sessionScope.editProduct.outDate }" readonly="readonly" />				
			</td>
		</tr>
		
		<tr>
			<td align="right" title="License截止时间">License截止时间:</td>
			<td><input id="licenseTime" name="licenseTime" type="text" style="width:80px" onclick="MyCalendar.SetDate(this)" value="${sessionScope.editProduct.licenseTime }" readonly="readonly" />
		</tr>
		
		<tr>
			<td align="right" title="硬件提供商">产品硬件提供商:</td>
			<td>
				<select id="hardwareSource" name="hardwareSource">
					<c:if test="${'1U_3710' == sessionScope.editProduct.hardwareSource}">
						<option value="1U_3710" selected="selected">1U_3710</option>
						<option value="1U_5400">1U_5400</option>
						<option value="2U_6840">2U_6840</option>
						<option value="2U_CAR3002C">2U_CAR3002C</option>
						<option value="宝德单路服务器">宝德单路服务器</option>
					</c:if>
					<c:if test="${'1U_5400' == sessionScope.editProduct.hardwareSource}">
						<option value="1U_3710" >1U_3710</option>
						<option value="1U_5400" selected="selected">1U_5400</option>
						<option value="2U_6840">2U_6840</option>
						<option value="2U_CAR3002C">2U_CAR3002C</option>
						<option value="宝德单路服务器">宝德单路服务器</option>
					</c:if>
					<c:if test="${'2U_6840' == sessionScope.editProduct.hardwareSource}">
						<option value="1U_3710" >1U_3710</option>
						<option value="1U_5400" >1U_5400</option>
						<option value="2U_6840" selected="selected">2U_6840</option>
						<option value="2U_CAR3002C">2U_CAR3002C</option>
						<option value="宝德单路服务器">宝德单路服务器</option>
					</c:if>
					<c:if test="${'2U_CAR3002C' == sessionScope.editProduct.hardwareSource}">
						<option value="1U_3710" >1U_3710</option>
						<option value="1U_5400" >1U_5400</option>
						<option value="2U_6840" >2U_6840</option>
						<option value="2U_CAR3002C" selected="selected">2U_CAR3002C</option>
						<option value="宝德单路服务器">宝德单路服务器</option>
					</c:if>
					<c:if test="${'宝德单路服务器' == sessionScope.editProduct.hardwareSource}">
						<option value="1U_3710" >1U_3710</option>
						<option value="1U_5400" >1U_5400</option>
						<option value="2U_6840" >2U_6840</option>
						<option value="2U_CAR3002C" >2U_CAR3002C</option>
						<option value="宝德单路服务器" selected="selected">宝德单路服务器</option>
					</c:if>
				</select>
			</td>
		</tr>	
		
		<tr>
			<td align="right" title="IP地址">IP地址:</td>
			<td><input id="ip" name="ip" style="width:200px;" value="${sessionScope.editProduct.ip }" /></td>
		</tr>
		
		<tr>
			<td align="right" title="子网掩码">子网掩码:</td>
			<td><input id="mask" name="mask" style="width:200px;" value="${sessionScope.editProduct.mask }"/></td>
		</tr>
		
		<tr>
			<td align="right" title="网关">网关:</td>
			<td><input id="gateway" name="gateway" style="width:200px;" value="${sessionScope.editProduct.gateway }"/></td>
		</tr>
		
		<tr>
			<td align="right" title="DNS">DNS:</td>
			<td><input id="dns" name="dns" style="width:200px;" value="${sessionScope.editProduct.dns }"/></td>
		</tr>
		
		<tr>
			<td align="right" title="节点数">节点数:</td>
			<td><input id="nodes" name="nodes" value="${sessionScope.editProduct.nodes }" /></td>
		</tr>
		
		<%-- <tr>
			<td align="right" title="模块">模块:</td>
			<td><input id="module" name="module" style="width:280px;" value="${sessionScope.editProduct.module }" /></td>
		</tr> --%>
		<tr>
			<td align="right" title="模块">模块:</td>
			<td>
				<select id="editModuleProduct" name="editModule" onchange="changeEditModuleInProduct()">
					<c:if test="${'所有模块' == sessionScope.editProduct.module}">
						<option value="默认模块" selected="selected">默认模块</option>
						<option value="定制模块" ">定制模块</option>
					</c:if>
					<c:if test="${!('所有模块' == sessionScope.editProduct.module)}">
						<option value="定制模块" selected="selected">定制模块</option>
						<option value="默认模块"">默认模块</option>
					</c:if>		
				</select>
					<c:if test="${!('所有模块' == sessionScope.editProduct.module)}">
						<input type="text" id="showEditModuleProduct" value="${sessionScope.editProduct.module }" style="width:250px;" />
					</c:if>
					<input type="text" id="showEditModuleProduct" value="${sessionScope.editProduct.module }" style="display:none;width:250px;" />
					<input type="text" id="eidtDefaultModuleProduct" value="所有模块" style="display:none;width:250px;" />
			</td>
		</tr>
		<%-- <tr>
			<td align="right" title="工作内容">工作内容:</td>
			<td><textarea rows="6" cols="35" name="workContent" id="workContent">${sessionScope.editProduct.workContent }</textarea></td>
		</tr> --%>
		<tr>
			<td align="right" title="Demo机硬件配置">产品硬件配置:</td>
			<td><textarea rows="5" cols="35" name="productConfig" id="productConfig" >${sessionScope.editProduct.productConfig}</textarea></td>
		</tr>
		<tr>
			<td align="right" title="工作记录">工作记录:</td>
			<td><textarea rows="5" cols="35" name="workNote" id="workNote">${sessionScope.editProduct.workNote }</textarea></td>
		</tr>
		
	</table>
</div>